package Plants;

public class PlantPair {
	
	PowerPlant plant1;
	PowerPlant plant2;
	
	public PlantPair()
	{
		
	}
	
	public PlantPair(PowerPlant plant1, PowerPlant plant2)
	{
		this();
		this.plant1 = plant1;
		this.plant2 = plant2;
	}
	
	public PowerPlant getPlant1() {
		return plant1;
	}

	public PowerPlant getPlant2() {
		return plant2;
	}
	
	@Override
	public String toString()
	{
		return plant1.getName() + plant2.getName();
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((plant1 == null) ? 0 : plant1.hashCode());
		result = prime * result + ((plant2 == null) ? 0 : plant2.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PlantPair other = (PlantPair) obj;
		if (plant1 == null) {
			if (other.plant1 != null)
				return false;
		} else if (!plant1.equals(other.plant1))
			return false;
		if (plant2 == null) {
			if (other.plant2 != null)
				return false;
		} else if (!plant2.equals(other.plant2))
			return false;
		return true;
	}

}
